﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;

namespace RpgParadizeAPI
{
    public class RpgParadize
    {
        public const string RPG_PARADIZE_ROOT_URL = "http://www.rpg-paradize.com/";
        public const string RPG_PARADIZE_OTHER_URL = RPG_PARADIZE_ROOT_URL + "top-site-Autre-10";

        public static RpgParadizePlace GetPlace(int id, string category)
        {
            for (int i = 0; i <= 4; i++)
            {
                try
                {
                    var url = category + "-" + i;//Get the category with the page(i)
                    var pageData = new StreamReader(WebRequest.Create(url).GetRequestStream());
                    var pageString = pageData.ReadToEnd();
                    pageData.Close();
                    Console.WriteLine(pageString);
                }
                catch (Exception e)
                {
                    throw new Exception("Failed to collect informations from this webpage or this place : " + e.Message);
                }
            }
            return null;
        }
    }
}
